package two.chapter_1.c1_3;

import edu.princeton.cs.algs4.StdOut;

import java.util.Stack;

public class Ex1_3_2 {

    public static void main(String [] args){
        Stack<String> stack=new Stack<>();
        String [] a={"it","was","-",
                "the","best","-",
                "of","times","-",
                "-","-","it",
                "was","-","the","-","-"};
        for (String item:a){
            stack.push(item);
        }

        for (String item :stack){
            StdOut.println(item);//按输入顺序依次输出，并不是栈该有的后进先出的行为
        }

    }
}
